﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="advanceSearch.aspx.cs" Inherits="map.member.advanceSearch" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
    <style type="text/css">
        #subcontent2 table 
        {
            width:100%;
            padding-bottom:5px;
        }
        #subcontent2  td
        {
            width:45px;
            padding-top:3px;
        }
        #subcontent2 td a
        {
            color:Blue;
        }
                #toprightdiv a
        {
            color:#666666;
        }
        .searchBodyDiv
        {
            border:solid 1px lightBlue;
            width:80%;
        }
        .searchBodyHeaderDiv
        {
            width:100%;
            height:20px;
            border-bottom:solid 1px lightBlue;
            background-color  :#F0F5F8;              
            padding-top:5px;        
        }
        .searchBodyHeaderDiv span
        {
            padding-left:20px;
            font-size:larger;    
            font-weight:bold;             
        }
        .searchBodyContentDiv
        {
            width:100%;
        }
        .searchBodyContentDiv hr
        {
            width:90%;
        }
        .searchBodyContentTable
        {
            padding:10px 10px 10px 10px;
        }
        .searchBodyContentTable .leftTd
        {
            font-size:medium ;
            font-weight:bold;
            color:Gray;
        }
        .searchBodyContentInfoTable
        {
            font-weight :bold;
            padding-left:50px;
        }
        .InfoLeftTd
        {
            width:100px;
            text-align:right;
        }
        .InfoRightTd
        {
            text-align:left;
            font-weight:normal ;
        }
        .searchBodyFooterDiv
        {
            text-align:center;
            width:100%;
            height:40px;
            background-color:#F0F5F8;
            padding-top:20px;
        }
        .input-button,.input-submit{background-color:#005eac;border-color:#b8d4e8 #124680 #124680 #b8d4e8;border-style:solid;border-width:1px;color:#fff;cursor:pointer;font-size:12px;padding:2px 15px;text-align:center}
       .ErrorMsgSpan
       {
           border :solid 1px red;
           background-color:#FFF2F2;
           width:150px;       
           margin-top:3px;
       }
    </style>
    <link href="../outstyle.css" rel="stylesheet" type="text/css" />
     <link href="../Stylesheet1.css" rel="stylesheet" type="text/css" />
    <script src="../js/dropdowncontent.js" type="text/javascript"></script>
</head>
<body>
<form id="form1" runat="server">
</form>
<div id="header">
        <div class="banner">
            <div class="logo">
                <a href="../default.aspx">
                    <img alt="藏宝网" src="../img/cbt.gif" style="width: 128px; height: 78px" />
                </a>
            </div>
            <div style="margin-top: 37px; float: left; margin-left: 10px">
                <div class="city" title="北京" id="currentProvinceDiv">
                    北京
                </div>
                <div class="city_selector" id="apf_id_5">
                    <div class="trigger">
                        <a class="switch" href="http://pages.f980.com/" id="contentlink" rel="subcontent2">[切换城市]</a></div>
                    
                </div>
            </div>
<div id="apf_id_6">
                <div id="toprightdiv" class="corner_links">
                &nbsp;&nbsp;&nbsp;
                    <asp:HyperLink ID="HyperLink_login" runat="server" >登录</asp:HyperLink>
                    <img src="/img/shuxian.gif" />&nbsp;<asp:HyperLink ID="HyperLink_logout" runat="server" NavigateUrl="/member/loginout.aspx" >注销</asp:HyperLink>
                    <img src="/img/shuxian.gif" />&nbsp;<a title="即时聊天" href="#" onclick="openChatRoom();" >聊天</a>
<%--                    <img src="/img/shuxian.gif" />&nbsp;<a title="我的好友" href="/member/pfriends.aspx" >我的好友</a>
                    <img src="/img/shuxian.gif" />&nbsp;<a title="我的店铺" href="/member/pshop.aspx" >我的店铺</a>
                    <img src="/img/shuxian.gif" />&nbsp;<a title="我的论坛" href="/member/pbbs.aspx" >我的论坛</a>
                    <img src="/img/shuxian.gif" />&nbsp;<a title="我的博客" href="/member/pblog.aspx">我的博客</a>--%>
                    <img src="/img/shuxian.gif" />&nbsp;<a title="会员中心" id="content_member"  
                                rel="DIV_member" href="member/pinfo.aspx" target="_blank">会员信息<img src="/img/ccc.gif" /></a>
                </div>
            </div>
            <div style="clear: right">
            </div>
            <div class="tabbar">
                <div class="tabs">
                    <a  title="商量购物" class="actived" style="padding-left: 0px; margin-left: 0px" href="../default.aspx">
                        网 购</a> 
                        <a title="用于展示的一件商品." href="../fang/default.aspx">商 品</a> 
                        <a title="一个实体店铺" href="../shenghuo/default.aspx">
                            商 铺</a> 
                            <a title="比较集中的区域,比如:中关村,木樨园等等." href="../gongzuo/default.aspx">地 标</a> 
                            <a title="协助店主开店,在线接待客户." href="/bbs/searchbroker.aspx">
                                经纪人</a> 
                                <a title="各地论坛" href="/bbs/searchbbs.aspx">各地论坛</a>
                </div>
                <div class="bg">
                    <div class="nw">
                    </div>
                    <div class="cen">
                    </div>
                    <div class="cen">
                    </div>
                    <div class="cen">
                    </div>
                    <div class="cen">
                    </div>
                    <div class="ne">
                    </div>
                </div>
                <div style="clear: both">
                </div>
            </div>
            <div style="clear: both">
            </div>
        </div>
        <div class="bar">
            <div class="bleft">
            </div>
            <div class="bright">
            </div>
        </div>
</div>

<DIV id="subcontent2" style="position:absolute; visibility: hidden; 
     border: 1px solid Gray; 
    background-color:White; width: 210px; height: 170px; padding: 4px; z-index:100;" >

<TABLE>
<TR>
<TD><a>安徽</a></TD>
<TD><A>北京</A></TD>
<TD><A>重庆</A></TD>
<TD><A>福建</A></TD>
<TD><A>甘肃</A></TD></TR>
<TR>
<TD><A>广东</A></TD>
<TD><A>广西</A></TD>
<TD><A>贵州</A></TD>
<TD><A>海南</A></TD>
<TD><A>河北</A></TD></TR>
<TR>
<TD><A>黑龙江</A></TD>
<TD><A>河南</A></TD>
<TD><A>湖北</A></TD>
<TD><A>湖南</A></TD>
<TD><A>江苏</A></TD></TR>
<TR>
<TD><A>江西</A></TD>
<TD><A>吉林</A></TD>
<TD><A>辽宁</A></TD>
<TD><A>内蒙古</A></TD>
<TD><A>宁夏</A></TD></TR>
<TR>
<TD><A>青海</A></TD>
<TD><A>山东</A></TD>
<TD><A>上海</A></TD>
<TD><A>山西</A></TD>
<TD><A>陕西</A></TD></TR>
<TR>
<TD><A>四川</A></TD>
<TD><A>天津</A></TD>
<TD><A>新疆</A></TD>
<TD><A>西藏</A></TD>
<TD><A>云南</A></TD></TR>
<TR>
<TD><A>浙江</A></TD>
<TD><A>香港</A></TD>
<TD><A>澳门</A></TD>
<TD><A>台湾</A></TD></TR>
</TABLE>

<div id="subcontent2CloseDiv" align="right"><a href="javascript:dropdowncontent.hidediv('subcontent2')">关闭</a></div> 
</DIV>

<DIV id="DIV_member" style="position:absolute; visibility: hidden; 
     border: 1px solid Gray; 
    background-color:White; width: 65px;  padding: 4px; z-index:100;" >
    <a href="../member/regist1.aspx">注册</a><br />
    <a href="../member/login.aspx">登录</a><br />
    <a href="../member/loginout.aspx">注销</a><br />
    <hr />
<a href="/member/pinfo.aspx">个人信息</a><br />
<a href="/member/pfriends.aspx">我的好友</a><br />
<a href="/member/pshop.aspx">我的店铺</a><br />
<a href="/member/pbbs.aspx">我的论坛</a><br />
<%--<a href="/member/pblog.aspx">我的博客</a><br />   --%>
    </DIV>

<table style="width: 100%">
        <tr>
            <td style="width: 200px; vertical-align: top;">
                会员信息<br />
                &nbsp;&nbsp;<a href="pinfo.aspx">个人信息</a><br />
                &nbsp;&nbsp;<a href="pfriends.aspx">我的好友</a><br />
                &nbsp;&nbsp;<a href="pshop.aspx">我的店铺</a><br />
                &nbsp;&nbsp;<a href="pbbs.aspx">我的论坛</a><br />
                &nbsp;&nbsp;<a href="pblog.aspx">我的博客</a><br />
                地标信息<br />
                &nbsp;&nbsp;<a href="area5.aspx">标注地标/小区位置</a><br />
                &nbsp;&nbsp;<a href="area5info.aspx">地标/小区详细信息</a><br />
                店铺信息<br />
                &nbsp;&nbsp;<a href="configshop.aspx" target="_blank">店铺装修</a><br />
                &nbsp;&nbsp;<a href="shoppic.aspx">实体图片</a><br />
                商品信息<br />
                &nbsp;&nbsp;<a href="Items.aspx" >查看我的商品</a><br />
                &nbsp;&nbsp;<a href="ItemCate.aspx" >增加新的商品</a><br />
                交易信息<br />
                <br />
            </td>
            <td style="vertical-align: top;">
                <form action ="searchFriends.aspx" method ="post" onsubmit ="return FilterValidate();">
                    <div class="searchBodyDiv">
                        <div class="searchBodyHeaderDiv">
                            <span>高级搜索</span>
                        </div>
                        <div class ="searchBodyContentDiv">
                            <table class ="searchBodyContentTable">
                                <%--基本信息--%>
                                <tr>
                                    <td style =" vertical-align:top ;" class ="leftTd">
                                         基本信息
                                    </td>
                                    <td class ="rightTd">
                                        <table class ="searchBodyContentInfoTable" cellspacing="5">
                                            <tr>
                                                <td class="InfoLeftTd">
                                                    姓名：
                                                </td>
                                                <td class ="InfoRightTd">
                                                    <input  style=" width:250px;" type="text" name="userName" id="userName" value="请输入姓名" onblur ="if(this.value=='')this.value='请输入姓名'; " onfocus="if(this.value=='请输入姓名') this.value='';"/>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="InfoLeftTd">
                                                    性别：
                                                </td>
                                                <td class ="InfoRightTd">
                                                    <input  type="radio" name ="userSexRadio" checked="true" value="All" id="AllSexRadio"/>&nbsp;<label for="AllSexRadio">不限</label>&nbsp;&nbsp;
                                                    <input  type="radio" name ="userSexRadio" value="男" id="MaleRadio"/>&nbsp;<label for="MaleRadio">男</label>&nbsp;&nbsp;
                                                    <input  type="radio" name ="userSexRadio" value="女" id="FemaleRadio"/>&nbsp;<label for="FemaleRadio">女</label>&nbsp;&nbsp;
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="InfoLeftTd">
                                                    家乡：
                                                </td>
                                                <td class ="InfoRightTd">
                                                    <select name="StateSelect" id="StateSelect" onchange ="stateSelectChanged(this);">
                                                        <option value="">请选择省份</option>
                                                    </select> &nbsp;
                                                    <select name="CitySelect" id="CitySelect">
                                                        <option value="">请选择城市</option>
                                                    </select>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                 <%--隔断--%>
                                <tr>
                                    <td colspan ="2">
                                        <hr />
                                    </td>
                                </tr>
                                <%--联系方式--%>
                                <tr>
                                    <td style =" vertical-align:top ;" class ="leftTd">
                                         联系方式
                                    </td>
                                    <td class ="rightTd">
                                        <table class ="searchBodyContentInfoTable" cellspacing="5">
                                            <tr>
                                                <td class="InfoLeftTd">
                                                    Email：
                                                </td>
                                                <td class ="InfoRightTd">
                                                    <input  style=" width:250px;" type="text" name="EmailAddress" id="EmailAddress" value="" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="InfoLeftTd">
                                                    QQ：
                                                </td>
                                                <td class ="InfoRightTd">
                                                    <input  style=" width:250px;" type="text" name="QQNumber" id="QQNumber" value="" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="InfoLeftTd">
                                                    MSN：
                                                </td>
                                                <td class ="InfoRightTd">
                                                    <input  style=" width:250px;" type="text" name="MSNNumber" id="MSNNumber" value="" />  
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                <%--隔断--%>
                                <tr>
                                    <td colspan ="2">
                                        <hr />
                                    </td>
                                </tr>
                                <%--学校信息--%>
                                <tr>
                                    <td style =" vertical-align:top ;" class ="leftTd">
                                         学校信息
                                    </td>
                                    <td class ="rightTd">
                                        <table class ="searchBodyContentInfoTable" cellspacing="5">
                                            <tr>
                                                <td class="InfoLeftTd">
                                                    大学：
                                                </td>
                                                <td class ="InfoRightTd">
                                                    <input  style=" width:150px;" type="text" name="collageName" id="collageName" value="" />
                                                    <select name="collageYearSelect" id="collageYearSelect">
                                                        <option value="">毕业年份</option>
                                                    </select>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="InfoLeftTd">
                                                    高中：
                                                </td>
                                                <td class ="InfoRightTd">
                                                    <input  style=" width:150px;" type="text" name="sSchoolName" id="sSchoolName" value="" />
                                                    <select name="sSchoolYearSelect" id="sSchoolYearSelect">
                                                        <option value="">毕业年份</option>
                                                    </select>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="InfoLeftTd">
                                                    初中：
                                                </td>
                                                <td class ="InfoRightTd">
                                                    <input  style=" width:150px;" type="text" name="jSchoolName" id="jSchoolName" value="" />
                                                    <select name="jSchoolYearSelect" id="jSchoolYearSelect">
                                                        <option value="">毕业年份</option>
                                                    </select>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                <%--隔断--%>
                                <tr>
                                    <td colspan ="2">
                                        <hr />
                                    </td>
                                </tr>
                                <%--工作信息--%>
                                <tr>
                                    <td style =" vertical-align:top ;" class ="leftTd">
                                         工作信息
                                    </td>
                                    <td class ="rightTd">
                                        <table class ="searchBodyContentInfoTable" cellspacing="5">
                                            <tr>
                                                <td class="InfoLeftTd">
                                                    公司：
                                                </td>
                                                <td class ="InfoRightTd">
                                                    <input  style=" width:250px;" type="text" id="lastEmployeeName" name="lastEmployeeName" value="" />
                                                </td>
                                            </tr>                                               
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <div class ="searchBodyFooterDiv" >
                             <input  type="submit" class ="input-submit" value="搜索"/>
                             <input  type="button" class ="input-button" value="清空条件" onclick ="clearAllFilter();"/>
                        </div>
                    </div>
                    <input  type ="hidden" value="1" name="searchType"/>
                </form>
            </td>
        </tr>
    </table>

    <script src="../js/cookie.js" type="text/javascript"></script>
    <script type="text/javascript">

        dropdowncontent.init("contentlink", "right-bottom", 300, "click");
        dropdowncontent.init("content_member", "left-bottom", 300, "mouseover");

        function stateAnchorClick(o) {
            o = o || window.event;
            var thisObj = o.srcElement || o.target;
            var currentprovincediv = document.getElementById('currentProvinceDiv');
            //bug:在移动地图到其它省份，想在返回北京，当前位置与目标位置相同，不移动到目标位置的Bug，把判断注释
            //if (currentprovincediv.innerHTML != thisObj.innerHTML) {
            currentprovincediv.innerHTML = thisObj.innerHTML;
            currentprovincediv.title = "您当前的位置 " + thisObj.innerHTML;
            //var oldProvince = decodeURI(getCookie("f980", "area"));
            AjaxFunction.setCurrentState(thisObj.innerHTML);
            if (typeof (moveMapToAddress) != 'undefined') {   ///地图页面的跳转
                moveMapToAddress(thisObj.innerHTML);
            }
            dropdowncontent.hidediv('subcontent2')
            //}
        }

        function initAllProvince() {
            var subcontent2Div = document.getElementById("subcontent2");
            var tableEleList = subcontent2Div.getElementsByTagName("table");
            if (tableEleList.length > 0) {
                var aEleList = tableEleList[0].getElementsByTagName("a");
                for (var i = 0; i < aEleList.length; i++) {
                    aEleList[i].onclick = stateAnchorClick;
                    aEleList[i].href = "#";
                }
            }
        }
        function initCurrentProvince() {
            var currentProvince = "";
            var result = AjaxFunction.getCurrentState();
            if (result.value != null && result.value != "") {
                currentProvince = result.value;
            }
            if (currentProvince == "") {
                currentProvince = "北京";
            }

            var currentProvincediv = document.getElementById("currentProvinceDiv");
            currentProvincediv.innerHTML = currentProvince;
            currentProvincediv.title = "您当前的位置 " + currentProvince;
        }


        function init() {
            initAllProvince();
            initCurrentProvince();
            initSelects();
        }

        init();

        function initYearSelect(selectEle) {
            var minYear = 1970;
            var maxYear =parseInt ( (new Date()).getFullYear());
            selectEle.innerHTML = "";
            var newOptionEle = document.createElement("option");
            newOptionEle.innerHTML = "毕业年份";
            newOptionEle.value = "";
            selectEle.appendChild(newOptionEle );
            for (var i = maxYear; i >= minYear  ; i--) {
                newOptionEle = document.createElement("option");
                newOptionEle.innerHTML = i.toString ();
                newOptionEle.value = i.toString();
                selectEle.appendChild(newOptionEle);
            }
        }
        function initSelects() {
            var collageYearSelect = document.getElementsByName("collageYearSelect")[0];
            var jSchoolYearSelect = document.getElementsByName("jSchoolYearSelect")[0];
            var sSchoolYearSelect = document.getElementsByName("sSchoolYearSelect")[0];
            initYearSelect(collageYearSelect);
            initYearSelect(jSchoolYearSelect);
            initYearSelect(sSchoolYearSelect);

            var statesSelect = document.getElementsByName("StateSelect")[0];
            statesSelect.innerHTML = "";
            var newOptionEle = document.createElement("option");
            newOptionEle.innerHTML = "请选择省份";
            newOptionEle.value = "";
            newOptionEle.selected = true;
            statesSelect.appendChild(newOptionEle);
            var allstatesResult = AjaxFunction.GetAllStates();
            if (allstatesResult.value != null && allstatesResult.value != "") {
                var allstates = eval(allstatesResult.value);
                for (var i = 0; i < allstates.length; i++) {
                    newOptionEle = document.createElement("option");
                    newOptionEle.innerHTML = allstates [i].state;
                    newOptionEle.value = allstates[i].state;
                    statesSelect.appendChild(newOptionEle);
                }
            }

            stateSelectChanged(statesSelect);
        }

        function stateSelectChanged(thisObj) {
            var citySelect = document.getElementsByName("CitySelect")[0];
            citySelect.innerHTML = "";
            var newOptionEle = document.createElement("option");
            newOptionEle.innerHTML = "请选择城市";
            newOptionEle.value = "";
            citySelect.appendChild(newOptionEle);
            var allCityResult = AjaxFunction.GetAllCitys(thisObj[thisObj.selectedIndex].value);
            if (allCityResult.value != null && allCityResult.value != "") {
                var allCitys = eval(allCityResult.value);
                for (var i = 0; i < allCitys.length; i++) {
                    newOptionEle = document.createElement("option");
                    newOptionEle.innerHTML = allCitys[i].city;
                    newOptionEle.value = allCitys[i].city;
                    citySelect.appendChild(newOptionEle); 
                }
            }
        }


        function clearAllFilter() {
            document.getElementById("AllSexRadio").checked =true 
            clearItemTextFilter("userName", "请输入姓名");
            clearItemTextFilter("EmailAddress", "");
            clearItemTextFilter("QQNumber", "");
            clearItemTextFilter("MSNNumber", "");
            clearItemTextFilter("collageName", "");
            clearItemTextFilter("jSchoolName", "");
            clearItemTextFilter("sSchoolName", "");
            clearItemTextFilter("lastEmployeeName", "");
            initSelects();
        }
        function clearItemTextFilter(id,replaceText) {
            var itemEle = document.getElementById(id);
            itemEle.value = replaceText;
            var itemParent = itemEle.parentNode;
            var errorMsgEles = itemParent.getElementsByTagName("span");
            var length = errorMsgEles.length;
            for (var i = 0; i < length; i++) {
                if (errorMsgEles[i].className = "ErrorMsgSpan") {
                    itemParent.removeChild(errorMsgEles[i]);
                }
            }
        }
        
        function validateFilterSubmit(id,func,errorMsg) {
            var filterEle = document.getElementById(id);
            if (filterEle != null) {
                var itemParent = filterEle.parentNode;
                var errorMsgEles = itemParent.getElementsByTagName("span");
                var length = errorMsgEles.length;
                for (var i = 0; i < length; i++) {
                    if (errorMsgEles[i].className == "ErrorMsgSpan") {
                        itemParent.removeChild(errorMsgEles[i]);
                    }
                }
                if (func(filterEle) == false) {
                    var newSpanEle = document.createElement("span");
                    newSpanEle.className = "ErrorMsgSpan";
                    newSpanEle.innerHTML = errorMsg;
                    filterEle.parentNode.appendChild(newSpanEle);
                    return false;
                }
            }
            return true;
        }

        function FilterValidate() {
            var result = true ;
            result = validateFilterSubmit("EmailAddress", function(textEle) {
                var textValue = textEle.value;
                if (textValue == "")
                    return true ;
                var textRegex = new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/);
                return textRegex.test(textValue);
            }, "Email格式不正确") && result;
            result = validateFilterSubmit("QQNumber", function(textEle) {
                    var textValue = textEle.value;
                    if (textValue == "")
                        return true;
                    var textRegex = new RegExp(/^[1-9]\d{4,8}$/);
                   return textRegex.test(textValue) ;
               }, "QQ号码格式不正确") && result;
           result = validateFilterSubmit("MSNNumber", function(textEle) {
                    var textValue = textEle.value;
                    if (textValue == "")
                        return true;
                    var textRegex = new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/);
                   return textRegex.test(textValue) ;
               }, "MSN格式不正确") &&result ;
           return result;
        }
        
        

        var child = null;
        function openChatRoom() {
            var chatroomUrl = "/usercate/chRoom.aspx";
            if (child == null) {
                var winobj = window.open(chatroomUrl, "newwindow", "height=500px, width=250px, top=0, left=800, toolbar=no, menubar=no, scrollbars=no, resizable=yes,location=no, status=no", true);
            }

        }
       
</script>
</body>
</html>
